package al.xc.common.exception;

public class SelfBaseException extends Exception {

    private Integer code;

    public SelfBaseException(ResultCodeDefine code, String errMsg) {
        super((null == errMsg) ? code.getDescription() : errMsg);
        this.code = code.getCode();
    }

    public SelfBaseException(ResultCodeDefine code, Throwable cause) {
        super((null == cause) ? new Throwable(code.getDescription()) : cause);
        this.code = code.getCode();
    }

    public Integer getCode() { return code; }
}
